package main

func twoSum(nums []int, target int) []int {
	newMap := make(map[int]int, 0)
	for k, value := range nums {
		if proindex, ok := newMap[target-value]; ok {
			return []int{proindex, k}
		} else {
			newMap[value] = k
		}
	}
	return []int{}
}
func main() {
	nums := []int{2, 7, 11, 15}
	twoSum(nums, 9)
}
